package com.luych.common.page;


import java.util.List;

public class Page {

    private long pageNumber;
    private long pageSize;
    private String sortName;
    private String sortOrder;
    private long recordCnt;
    private List records;

    public long getPageStart() {
        return pageSize * (pageNumber - 1);
    }

    public long getPageEnd() {
        return pageSize * pageNumber - 1;
    }

    public long getPageCnt() {
        return new Double(Math.ceil(recordCnt * 1.0 / pageSize)).longValue();
    }

    public long getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(long pageNumber) {
        this.pageNumber = pageNumber;
    }

    public long getPageSize() {
        return pageSize;
    }

    public void setPageSize(long pageSize) {
        this.pageSize = pageSize;
    }

    public long getRecordCnt() {
        return recordCnt;
    }

    public void setRecordCnt(long recordCnt) {
        this.recordCnt = recordCnt;
    }

    public List getRecords() {
        return records;
    }

    public void setRecords(List records) {
        this.records = records;
    }

    public String getSortName() {
        return sortName;
    }

    public void setSortName(String sortName) {
        this.sortName = sortName;
    }

    public String getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(String sortOrder) {
        this.sortOrder = sortOrder;
    }
}
